﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Common/MasterPages/Dialog.Master" AutoEventWireup="true" CodeBehind="ZHArchForm.aspx.cs" Inherits="DMS.Web.Modules.ArchivesManagement.ZHArchForm" %>
<%@ Register Src="~/Modules/ArchivesManagement/AttachmentList.ascx" TagName="AttachmentList" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PageTitle" runat="server">
    <%=string.IsNullOrEmpty(Title)?"综合资料信息":Title+"(综合资料)"%>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainHolder" runat="server">
    <script type="text/javascript" src="/Resources/scripts/jquery.blockUI.js"></script>
    <script type="text/javascript" src="/Resources/Scripts/jquery-ui/ui/jquery.ui.core.min.js"></script>
	<script type="text/javascript" src="/Resources/Scripts/jquery-ui/ui/jquery.ui.widget.min.js"></script>
	<script type="text/javascript" src="/Resources/Scripts/jquery-ui/ui/jquery.ui.position.min.js"></script>
	<script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.mouse.min.js"></script>
    <script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.draggable.min.js"></script>
    <script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.button.min.js"></script>
    <script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.dialog.min.js"></script>
    <link rel="stylesheet" href="/Resources/Scripts/jquery-ui/themes/cupertino/jquery.ui.all.css">
<script type="text/javascript">
    function getClientIds() {
        return {
            hiddenSaveBtn: '#<%= hiddenSaveBtn.ClientID %>',
            custodyBeginDate: '#<%= CustodyBeginDate.ClientID %>',
            custodyEndDate: '#<%= CustodyEndDate.ClientID %>',
            custodyBeginDateL: '#<%= CustodyBeginDateL.ClientID %>',
            custodyEndDateL: '#<%= CustodyEndDateL.ClientID %>',
            custodyYear: '#<%= CustodyYear.ClientID %>',
            yongjiu: '#<%= Yongjiu.ClientID %>'
        };
    }

    function uploadTemplate() {
        var template = "/Resources/Templates/基本信息导入模板-单位.xls";
        var fileInfo = OpenFileUploaderWithFile("", template);
    }

    function OperatConfirm() {
        //        $("#dialog-confirm").dialog("open");
        saveClick();
        return false;
    }

    $(function () {
        $("#dialog-confirm").dialog({
            resizable: false,
            height: 190,
            width: 480,
            modal: true,
            autoOpen: false,
            buttons: {
                "1.新建资料": function () {
                    //                    window.open('ArchInfoForm.aspx');
                    $(this).dialog("close");
                    saveClick();
                    //alert('保存成功！');
//                    window.opener = null;
//                    window.open("", "_self");
//                    window.close();
                },
                "2.继续录入": function () {
                    $(this).dialog("close");
                    saveClick();
                    //alert('保存成功！请继续添加资料信息。');
//                    window.location.href = window.location;
                },
                "3.关闭": function () {
                    $(this).dialog("close");
                    saveClick();
                    //alert('保存成功！');
//                    window.opener = null;
//                    window.open("", "_self");
//                    window.close();
                }
            }
        });
    });

</script>
<script type="text/javascript" src="/Modules/ArchivesManagement/Scripts/ArchInfoForm.js"></script>
    <fieldset>
    <legend>
        综合资料信息
    </legend>
    <div id="divContent" style="padding-top: 5px;" runat="server">
        <table cellpadding="1" cellspacing="2" border="0" class="orderformitem" width="98%">
            <tr>
                <th>
                    <nobr>
                        档案盒编号：
                    </nobr>
                </th>
                <td>
                    <asp:HiddenField ID="HiddenField1" runat="server" />
                    <asp:HiddenField ID="Type" runat="server" />
                    <asp:TextBox ID="BoxCode" runat="server"></asp:TextBox><span class="red">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorBoxCode" ControlToValidate="BoxCode"
                        runat="server" ErrorMessage="请输入！"  ForeColor="Red" SetFocusOnError="true" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
                <th>
                    <nobr>
                        档案盒所在位置：
                    </nobr>
                </th>
                <td>
                    <asp:TextBox ID="BoxPosition" runat="server"></asp:TextBox><span class="red">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorBoxPosition" ControlToValidate="BoxPosition"
                        runat="server" ErrorMessage="请输入！" ForeColor="Red" SetFocusOnError="true" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>
                    <nobr>
                        档案名称：
                    </nobr>
                </th>
                <td>
                    <asp:HiddenField ID="ArchivesID" runat="server" />
                    <asp:HiddenField ID="BaseInfoID" runat="server" />
                    <asp:TextBox ID="Name" runat="server"></asp:TextBox><span class="red">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="Name"
                        runat="server" ErrorMessage="请输入！" ForeColor="Red" SetFocusOnError="true" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
                <th>
                    所属年度：
                </th>
                <td>
                    <asp:DropDownList ID="BelongYear" runat="server" Width="55px">
                        <asp:ListItem Value="2014" Text="2014"></asp:ListItem>
                        <asp:ListItem Value="2013" Text="2013"></asp:ListItem>
                        <asp:ListItem Value="2012" Text="2012"></asp:ListItem>
                        <asp:ListItem Value="2011" Text="2011"></asp:ListItem>
                        <asp:ListItem Value="2010" Text="2010"></asp:ListItem>
                        <asp:ListItem Value="2009" Text="2009"></asp:ListItem>
                        <asp:ListItem Value="2008" Text="2008"></asp:ListItem>
                        <asp:ListItem Value="2007" Text="2007"></asp:ListItem>
                        <asp:ListItem Value="2006" Text="2006"></asp:ListItem>
                        <asp:ListItem Value="2005" Text="2005"></asp:ListItem>
                        <asp:ListItem Value="2004" Text="2004"></asp:ListItem>
                        <asp:ListItem Value="2003" Text="2003"></asp:ListItem>
                        <asp:ListItem Value="2002" Text="2002"></asp:ListItem>
                        <asp:ListItem Value="2001" Text="2001"></asp:ListItem>
                    </asp:DropDownList>
                    年<span class="red">*</span>                                       
                </td>                  
            </tr>
            <tr>
                <th>
                    <nobr>
                        档案形成日期：
                    </nobr>
                </th>
                <td>
                    <asp:TextBox ID="InitDate" onblur="setBeginDate(this)"  onClick="WdatePicker()" runat="server"></asp:TextBox><span class="red">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="InitDate"
                        runat="server" ErrorMessage="请输入！" ForeColor="Red" SetFocusOnError="true" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
                <th>
                    <nobr>
                        档案保管起始日期：
                    </nobr>
                </th>
                <td>
                    <asp:Label ID="CustodyBeginDateL" runat="server"></asp:Label>
                    <asp:HiddenField ID="CustodyBeginDate" runat="server"></asp:HiddenField>
                </td>
            </tr>
            <tr>
                <th>
                    <nobr>
                        保管年限(0为永久)：
                    </nobr>
                </th>
                <td>
                    <asp:TextBox ID="CustodyYear" runat="server" onchange="setCustodyEndDate(this.value)"  onblur="if(this.value&&(parseInt(this.value)!=this.value||this.value<0)){alert('请输入合法数字！');this.value='';$(this).focus();return false;}">0</asp:TextBox><span class="red">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" ControlToValidate="CustodyYear"
                        runat="server" ErrorMessage="请输入！" ForeColor="Red" SetFocusOnError="true" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
                <th>
                    <nobr>
                        档案到期日期：
                    </nobr>
                </th>
                <td>
                     <asp:Label ID="CustodyEndDateL" runat="server"></asp:Label>
                     <asp:HiddenField ID="CustodyEndDate" runat="server"></asp:HiddenField>
                     <asp:Label ID="Yongjiu" runat="server"></asp:Label>
                </td>                
            </tr>
            <tr>
                <th>
                    <nobr>
                        张数：
                    </nobr>
                </th>
                <td>
                    <asp:TextBox ID="PageCount" runat="server" onblur="if(this.value&&(parseInt(this.value)!=this.value||this.value<0)){alert('请输入合法数字！');this.value='';$(this).focus();}"></asp:TextBox><span class="red">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator11" ControlToValidate="PageCount"
                        runat="server" ErrorMessage="请输入！" ForeColor="Red" SetFocusOnError="true" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
                <th>
                    是否销毁：
                </th>
                <td>
                    <asp:DropDownList ID="IsDestroy" runat="server" Width="50px">
                        <asp:ListItem Value="False" Text="否"></asp:ListItem>
                        <asp:ListItem Value="True" Text="是"></asp:ListItem>                        
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <th>
                    <nobr>
                        档案录入人员：
                    </nobr>
                </th>
                <td>
                    <asp:Label ID="InputPersonName" runat="server"></asp:Label>
                    <asp:HiddenField ID="InputPersonID" runat="server"></asp:HiddenField>
                    <asp:HiddenField ID="DeptName" runat="server"></asp:HiddenField>
                    <asp:HiddenField ID="DeptID" runat="server"></asp:HiddenField>
                </td>
                <th>
                    档案录入日期：
                </th>
                <td>
                    <asp:Label ID="InputDate" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <th>
                    <nobr>
                        备注：
                    </nobr>
                </th>
                <td colspan="3">
                    <asp:TextBox ID="Remark" TextMode="MultiLine" Rows="4" Width="96%" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <nobr>
                        补充说明：
                    </nobr>
                </th>
                <td colspan="3">
                    <asp:TextBox ID="Supplement" TextMode="MultiLine" Rows="4" Width="96%" runat="server"></asp:TextBox>
                </td>
            </tr>
    </table></div>
    </fieldset>

    <fieldset>
    <legend>
        资料扫描件列表
    </legend>
    
    <uc1:AttachmentList ID="AttachmentList" runat="server" />

    </fieldset>
    <div id="dialog-confirm" title="请选择后续操作" style="display:none">
	<span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 65px 0;"></span>请选择具体后续操作：
    <br /><br />1.新建资料：保存后弹出新建窗口，并清空表单数据；<br />
    2.继续录入：保存后弹出新建窗口，并自动补全表单数据，录入员只要修改部分字段即可提交；<br />
    3.关闭：保存并关闭窗口。
    </div>
</asp:Content>

<asp:Content ID="ctFooter"  ContentPlaceHolderID="FooterHolder" runat="server">
<asp:LinkButton ID="btnSave" CssClass="linkbtn" runat="server" OnClientClick="return OperatConfirm();"
        CausesValidation="true"><span>保存</span></asp:LinkButton>&nbsp;&nbsp;
<a href="javascript:window.opener=null;window.open('','_self').close();" class="linkbtn"><span>关闭</span></a>
<asp:LinkButton ID="hiddenSaveBtn" CssClass="linkbtn" runat="server" OnClick="btnSave_Click"
        CausesValidation="true" style="display: none"><span>保存</span></asp:LinkButton>
</asp:Content>